<?php

  function get_current_friends($nick) {
    $data = @file_get_contents('http://klab.lv/users/'.$nick.'/data/foaf');

    $pattern = '/<foaf:nick>(\w+)<\/foaf:nick>/';
    preg_match_all($pattern, $data, $matches);
    
    if (!isset($matches[1])) 
      return array();
    
    return $matches[1];
  }  



?>
